﻿using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Guids;

namespace Ocean.His.MedicalInsurance
{
    public class MedicalInsuranceTestProvider : MedicalInsuranceBaseProvider, ISingletonDependency
    {
        private ILogger _logger;

        public MedicalInsuranceTestProvider(ILogger logger, MedicalInsuranceOption medicalInsuranceOption, IGuidGenerator guidGenerator) : base(logger, medicalInsuranceOption, guidGenerator)
        {
            _logger = logger;
        }

        public override Tuple<int, string> Init(InitRequestModel initRequestModel)
        {
            return new Tuple<int, string>(0, "ok");
        }

        public override Tuple<int, string> ChangePIN()
        {
            return new Tuple<int, string>(0, "ok");
        }

        public override Tuple<int, string> SiPost<T>(T requestModel)
        {
            if (requestModel is SI1101RequestModel)
            {
                var result = "{\"idetinfo\":[],\"baseinfo\":{\"certno\":\"210403196110044221\",\"psn_no\":\"21000021040021040021116483\",\"gend\":\"2\",\"brdy\":\"1961-10-04\",\"naty\":\"\",\"psn_cert_type\":\"01\",\"psn_name\":\"乔颖\",\"age\":61},\"insuinfo\":[{\"insuplc_admdvs\":\"210400\",\"psn_insu_date\":\"\",\"cvlserv_flag\":\"0\",\"balc\":1093.51,\"psn_type\":\"1201\",\"emp_name\":\"中国能源建设集团东北电力第一工程有限公司\",\"psn_insu_stas\":\"1\",\"insutype\":\"310\",\"paus_insu_date\":\"\"}]}";
                return new Tuple<int, string>(0, result);
            }

            return base.SiPost(requestModel);
        }
    }
}
